package com.tjetc.字节流;

import java.io.FileOutputStream;
import java.io.IOException;

public class T01FileOutputStream {
    public static void main(String[] args) throws IOException {
        FileOutputStream outputStream = new FileOutputStream("myfile.txt");
        //写入一个字节
        outputStream.write(97);
        //写入一个字符串
        outputStream.write("hello".getBytes());
        //写入字符串的一部分
        outputStream.write("hello".getBytes(),1,3);
        outputStream.close();

    }
}
